<form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <td>
                        <a href="javascript:sort('user_id');">ID</a>
                    </td>
                    <td>
                        <a href="javascript:sort('username');">会员昵称</a>
                    </td>
                    <td>
                        <a href="javascript:sort('head_pic');">会员头像</a>
                    </td>
                    <td>
                        <a href="javascript:sort('sex');">性别</a>
                    </td>
                    <td>
                        <a href="javascript:sort('price');">余额</a>
                    </td>
                    <td>
                        <a href="javascript:sort('integral');">积分</a>
                    </td>
                    <td>
                        <a href="javascript:sort('up_time');">注册日期</a>
                    </td>
                    <td class="text-right">操作</td>
                </tr>
            </thead>
            <tbody>
            <volist name="userList" id="list">
                <tr style="line-height:32px;">
                <td style="line-height:32px;">{$list.id}</td>
                <td style="line-height:32px;">{$list.user_name}</td>
                <td style="line-height:32px;">
                	<a href="{$list.head_picture}" target="_blank">
                    	<img src="{$list.head_picture}" height="25">
                    </a>
                </td>
                <td style="line-height:32px;"><if condition="$list['sex'] eq 1">男<elseif condition="$list['sex'] eq 2" />女<else />保密</if></td>
                <td style="line-height:32px;">￥{$list.price}</td>
                <td style="line-height:32px;">{$list.give_integral}</td>
                <td style="line-height:32px;">{$list.add_time|date='Y-m-d H:i',###}</td>
                <td class="text-right">
                	<a href="{:U('Admin/User/balance',array('id'=>$list['id']))}" data-toggle="tooltip" title="查看明细" class="btn btn-info"><i class="fa fa-eye"></i></a>
                    <a href="{:U('Admin/User/detail',array('id'=>$list['id']))}" data-toggle="tooltip" title="" class="btn btn-info"><i class="fa fa-pencil"></i></a>
                    <!--<a class="btn btn-danger" onclick="delfunc(this,1)" data-url="{:U('Admin/User/freeze')}" data-id="{$list['id']}"><if condition="$list['status'] eq 1">冻结<else />解冻</if></a>-->
                </td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>
</form>
<div class="row">
    <div class="col-sm-3 text-left"></div>
    <div class="col-sm-9 text-right">{$page}</div>
</div>
<script>
    function delfunc(obj,num) {
		if (confirm('确认冻结吗？')) {
			$.ajax({
				type: 'post',
				url: $(obj).attr('data-url'),
				data: {
					act: 'del',
					id: $(obj).attr('data-id')
				},
				dataType: 'json',
				success: function(data) {
					if (data.code==200) {
						if(data.status==1){
							$(obj).parent().prev().prev().html('正常');
							$(obj).html('冻结');
						}else{
							$(obj).parent().prev().prev().html('<span style="color:red;">冻结</span>');
							$(obj).html('解冻');
						}
					} else {
						layer.alert('冻结失败', {
							icon: 2
						});
					}
				}
			});
		}
	}
    $(".pagination  a").click(function () {
        var page = $(this).data('p');
        ajaxGetTable('search-form2', page);
    });
</script>
